package Book;

//书架
public class BookList {
    //书架容纳数量
    protected static final int DEFAULE_SIZE = 10;

    //书架数组
    private Book[] books = new Book[DEFAULE_SIZE];

    protected int useSize;
    public BookList() {
        books[0] = new Book("三国演义","罗贯中",25,"小说");
        books[1] = new Book("朝花夕拾","鲁迅",26,"小说");
        books[2] = new Book("阿Q正传","鲁迅",24,"小说");
        this.useSize = 3;
    }
    public Book getBook (int i) {
        return this.books[i];
    }

    public void setBooks(Book book) {
        this.books[useSize] = book;
    }

    public void setBooks(int pos,Book book) {
        this.books[pos] = book;
    }
    public int getUseSize() {
        return useSize;
    }

    public void setUseSize(int useSize) {
        this.useSize = useSize;
    }

}
